package com.yoyo.itravel.service;

import com.yoyo.itravel.bean.Flight;
import com.yoyo.itravel.exceptions.FlightException;

import java.util.List;

/**
 * 航班表服务层接口【服务层】
 * @Author: liuchaojie
 * @Date 2020/6/18 17:06
 */
public interface IFlightService {

    /**
     * 增加航班
     * @param flight
     * @return
     * @throws FlightException
     */
    boolean insertFlight(Flight flight) throws FlightException;

    /**
     * 根据flightId删除一条航班信息
     * @param flightId
     * @return
     * @throws FlightException
     */
    boolean deleteByFlightId(String flightId) throws FlightException;

    /**
     * 查找所有航班信息表
     * @return
     * @throws FlightException
     */
    List<Flight> selectAll() throws FlightException;


    /**
     * 根据 airlineId、departCity、arrivalCity、departTime查询航班
     * @param flight
     * @return
     * @throws FlightException
     */
    List<Flight> selectByCondition(Flight flight) throws FlightException;

    /**
     * 修改航班信息
     * @param flight
     * @return
     * @throws FlightException
     */
    boolean updateFlight(Flight flight) throws FlightException;

    /**
     * 根据航班id修改在售状态
     * @param flightId
     * @param isOnSell
     * @return
     * @throws FlightException
     */
    boolean updateIsOnSell(String flightId, Integer isOnSell) throws FlightException;
}
